home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Devices / NuBus⁄Slot Manager / Declaration ROMs / MinimalDeclROM.a
Encoding:
Text File  |  1992-08-14  |  7.4 KB  |  169 lines  |  [TEXT/MPS ]

  1.  
  2. ;-------------------------------------------------------------------
  3. ;
  4. ;  General structure of a minimal configuration ROM:
  5. ;
  6. ;                    [Format/Header]
  7. ;                            |
  8. ;                            |
  9. ;                [sResource Directory]
  10. ;                            /        
  11. ;                           /         
  12. ;                          /              
  13. ;                         /               
  14. ;            [Board sResource]
  15. ;                        
  16. ;                            
  17. ;
  18. ; This minimal ROM has a Format header block, and an sResource Directory
  19. ; that points to a board sResource.  Note that the OSLstEntry, and DatLstEntry
  20. ; Macros basically strip off the high byte and calculate the offset or data
  21. ; values.  If the file fails to assemble, and the error points to a macro 
  22. ; argument, usually a label can't be found. 
  23. ;
  24. ;-------------------------------------------------------------------
  25.  
  26.             MACHINE        MC68020
  27.  
  28. ;=====================================================================
  29. ;    Initial Assembler Directives
  30. ;=====================================================================
  31.                 STRING     C
  32.  
  33.                 PRINT    OFF
  34.                 INCLUDE    'SysErr.a'                        ;Macintosh System equates
  35.                 INCLUDE    'SysEqu.a'                        ;Macintosh System equates
  36.                 INCLUDE    'ROMEqu.a'                        ;Declaration ROM equates
  37.                 INCLUDE    'SlotEqu.a'                        ;Slot Manager equates and macros
  38.                 INCLUDE    'TimeEqu.a'                        ;Macintosh traps
  39.                 INCLUDE    'Traps.a'                        ;Macintosh traps
  40.                 PRINT    ON
  41.  
  42. ;=====================================================================
  43. ;    BEGIN Declaration ROM
  44. ;=====================================================================
  45. MinimalDeclROM    MAIN
  46.  
  47.                 
  48. ;*************************************************************
  49. ;Constants
  50. ;*************************************************************
  51.   
  52. ROMSize            EQU        $1000                    ;4K byte ROM
  53. TheBoardId        EQU        $9999                    ;the Board Id (DON'T USE-get this from DTS)
  54.  
  55. ;-----------  sResource Directory                ;<Id OF>
  56. sRsrc_Board        EQU        1                        ;Board sResource {May be any number in [0..127]}
  57.  
  58.  
  59.  
  60. ;=====================================================================
  61. ;        Directory 
  62. ;=====================================================================
  63. _sRsrcDir        OSLstEntry    sRsrc_Board,_sRsrc_Board        ;References the board sResource.
  64.                 DatLstEntry    endOfList,0                        ;End of the list.
  65.  
  66.  
  67. ;=============================================================
  68. ;            sRsrc_Board List - the Board sResource
  69. ;=============================================================
  70. _sRsrc_Board    OSLstEntry    sRsrcType,_BoardType            ;References the sResource type
  71.                 OSLstEntry    sRsrcName,_BoardName            ;References the sResource name.
  72.                 DatLstEntry    boardId,TheBoardId                ;The board Id.
  73.                 OSLstEntry    vendorInfo,_VendorInfo            ;References the OPTIONAL Vendor information list.
  74.                 DatLstEntry    endOfList,0                        ;End of the list.
  75.                 
  76.                                                             ;The Board sResource :    
  77. _BoardType        DC.W    CatBoard                            ;<Category>    CatBoard ALWAYS = $0001 for bd srsrc 
  78.                 DC.W    TypBoard                            ;<Type>        TypBoard ALWAYS = $0000 for bd srsrc
  79.                 DC.W    0                                    ;<DrvrSw>    CatBoard ALWAYS = $0000 for bd srsrc
  80.                 DC.W    0                                    ;<DrvrHw>    CatBoard ALWAYS = $0000 for bd srsrc
  81. _BoardName        DC.L    'Macintosh II video card'            ;The name of the Board - should be
  82.                                                             ;the official product name
  83.                 
  84.                                 
  85. ;-------------------------------------------------------------
  86. ;            Vendor Info record 
  87. ; Notes:
  88. ;    Vendor info is OPTIONAL - not required in the board sResource
  89. ;    Vendor info is Vendor specific - MacDTS DOES NOT ASSIGN these values
  90. ;-------------------------------------------------------------
  91. _VendorInfo        OSLstEntry    VendorId,_VendorId                ;References the Vendor Id.
  92.                 OSLstEntry    RevLevel,_RevLevel                ;References the Revision Level.
  93.                 OSLstEntry    PartNum,_PartNum                ;References the Part Number.
  94.                 DatLstEntry    endOfList,0                        ;End of the list.
  95.  
  96. _VendorId        DC.L    'YourCompany, Inc.'                    ;The Vendor Id (whatever is desired)
  97. _RevLevel        DC.L    '1.0'                                ;The Revision Level (whatever is desired)
  98. _PartNum        DC.L    'ABC-1'                                ;The Part Number (whatever is desired)
  99.  
  100. ;-------------------------------------------------------------
  101. ;            other (functional) sResources 
  102. ; Normally, in addition to the required board sResource, you would have a 
  103. ; "functional sResource" type.  The functional sResource is recommended in 
  104. ; addition to the board sResource, and exists to tell the world what type of 
  105. ; function(s) your board can perform.  There is usually one of these 
  106. ; functional sResources for each function the board can perform.  Applications
  107. ; or drivers typically look for their card by making a slot manager call
  108. ; to find the particular functional sResource (if found, the slot manager
  109. ; will return the slot id the functional sResource was found in).  This, is,
  110. ; for example how QuickDraw finds video boards - allowing multiple vendors
  111. ; and video boards made after QuickDraw was written.  In this way, applications
  112. ; can find new boards without having to hard code to boards (and thus require
  113. ; rebuilding in order to use new boards).  Functional sResources have software
  114. ; driver ids associated with them, so applications can make driver calls to the
  115. ; boards.  The advantage is that the underlying hardware (register addresses,
  116. ; and other hardware specific items) don't matter to the higher level application
  117. ; software, and the board can be revised or new boards added without having to 
  118. ; change the application.  Again, QuickDraw and the video driver are good 
  119. ; examples - once a driver interface has been defined, applications don't need
  120. ; to worry about the actual hardware.
  121. ;
  122. ; MacDTS assigns functional sResources.  Write in to DTS with the following 
  123. ; information:
  124. ;    - What the board will do (so we can assign the functional sResource values)
  125. ;    - the official product name for the board (or a code name)
  126. ;    - whether or not the board will have a software driver other than one
  127. ;      which has been pre-defined (like Apple's video driver).
  128. ;    - whether or not the board will have driver that will be on board 
  129. ;      (that is, in the ROM), or whether or not it will be a driver that
  130. ;      gets installed at init time, in the application, etc.
  131. ;    - company address (mailing and electronic addresses if possible) and
  132. ;      the name of the person in the company responsible for the board (with
  133. ;      a phone number if possible).
  134. ;
  135. ; MacDTS will then assign the values for the functional sResource(s); that is DTS
  136. ; will assign the Category, cType, DrvrSw and DrvrHw ids for all functional
  137. ; sResources.  (Note that the board sResource is a degenerate case of functional
  138. ; sResources - it tells the slot manager that the board can perform the function
  139. ; of begin a board.  If the slot manager can't find this sResource, it marks the 
  140. ; slot as empty.  The board sResource has the Category, cType, DrvrSw and DrvrHw 
  141. ; ids already defined - see the comment in the board sResource section above.)
  142. ; MacDTS maintains a database of board ids and functional sResource ids to prevent 
  143. ; id conflicts.  The database is highly confidential to MacDTS eyes-only since it
  144. ; has unannounced products on it.
  145. ;-------------------------------------------------------------
  146.  
  147.  
  148.                 ORG     ROMSize-FHeaderRec.fhBlockSize
  149. ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  150. ;            Format/Header Block
  151. ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  152.                 DC.L    (_sRsrcDir-*)**$00FFFFFF            ;Offset to sResource directory
  153.                 DC.L    ROMSize                                ;Length of declaration data
  154.                 DC.L    0                                    ;CRC {Patched by crcPatch (MPW tool)}
  155.                 DC.B    romRevision                            ;Revision level
  156.                 DC.B    AppleFormat                            ;Format
  157.                 DC.L    TestPattern                            ;Test pattern
  158.                 DC.B    0                                    ;Reserved byte (must be zero)
  159.                 DC.B    $E1                                    ;ByteLanes: 1110 0001 (bytelane 0)
  160.  
  161.  
  162.                 ENDP
  163.  
  164.             
  165.                 END
  166.  
  167.